package com.example.musicaiap.service

import androidx.media3.common.MediaItem

/**
 * 播放状态封装类
 * 使用密封类来表示不同的播放状态
 */
sealed class PlaybackState {
    object Initial : PlaybackState()
    data class Ready(
        val currentMediaItem: MediaItem?,
        val mediaItemIndex: Int,
        val mediaItemCount: Int,
        val isPlaying: Boolean,
        val currentPosition: Long,
        val duration: Long,
        val repeatMode: Int
    ) : PlaybackState()
    data class Ended(val currentMediaItem: MediaItem?) : PlaybackState()
    data class Buffering(
        val currentMediaItem: MediaItem?,
        val mediaItemIndex: Int,
        val mediaItemCount: Int,
        val isPlaying: Boolean,
        val repeatMode: Int
    ) : PlaybackState()
    data class Error(val message: String) : PlaybackState()
} 